package com.hl.controller;

import com.hl.domain.Heartmarktopic;
import com.hl.service.HeartmarktopicService;
import com.hl.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/topic")
public class HeartmarktopicController {
    @Autowired
    private HeartmarktopicService heartmarktopicService;

    ////根据heartmark测评试卷表的id查询试题
    @GetMapping
    public R selectAll(Integer id){
        List<Heartmarktopic> heartmarktopics = heartmarktopicService.selectAll(id);
        return heartmarktopics!=null?R.success(heartmarktopics):R.fail(null);
    }
}
